package com.xue566.controller;

import com.xue566.config.LogPointer;
import com.xue566.entity.StudentEntity;
import com.xue566.service.IStudentService;
import com.xue566.util.ResultBody;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.UUID;

/**
 * @Author: Wuzh
 * @Description:
 * @Date Created in 12:55 2020/8/23
 * @return
 */
@RequestMapping("/student/client")
@RestController
@Slf4j
@CrossOrigin(value = "*", maxAge = 3600)
public class StudentController {

    @Resource
    private IStudentService iStudentService;

    @LogPointer(value = "学生客户端日志")
    @RequestMapping("/queryList")
    public ResultBody<StudentEntity> queryList(@RequestBody StudentEntity studentEntity){
        studentEntity.setTrackId(UUID.randomUUID().toString());
        ResultBody<StudentEntity> studentEntitys = iStudentService.queryList(studentEntity);
        log.info("学生列表客户端 - {}", studentEntitys);
        return studentEntitys;
    }
}
